<template>
  <div class="chat-interface">
    <!-- 左侧边栏 -->
    <div class="sidebar">
      <div class="sidebar-header">
        <div class="user-info">
          <div class="user-avatar">
            <div class="avatar-placeholder">👤</div>
          </div>
          <div class="user-details">
            <span class="user-name">福利官</span>
            <span class="user-status">在线</span>
          </div>
        </div>
      </div>
      
      <div class="sidebar-nav">
        <div class="nav-item active">
          <i class="nav-icon">💬</i>
          <span>工作台</span>
        </div>
        <div class="nav-item">
          <i class="nav-icon">📧</i>
          <span>邮件</span>
        </div>
        <div class="nav-item">
          <i class="nav-icon">📋</i>
          <span>报表</span>
        </div>
      </div>
      
      <div class="chat-stats">
        <div class="stat-item">
          <span class="stat-label">正在接待</span>
          <span class="stat-value">0</span>
        </div>
      </div>
    </div>

    <!-- 聊天列表 -->
    <div class="chat-list">
      <div class="chat-list-header">
        <div class="search-box">
          <input type="text" placeholder="联系人、群聊、聊天记录" />
          <i class="search-icon">🔍</i>
        </div>
      </div>
      
      <div class="chat-items">
        <div class="chat-item active">
          <div class="chat-avatar">
            <div class="avatar-placeholder">👤</div>
          </div>
          <div class="chat-info">
            <div class="chat-name">lukfey爱卡菲源码站...</div>
            <div class="chat-preview">可以了，谢谢</div>
            <div class="chat-time">2025.8.7 09:25:44</div>
          </div>
        </div>
        
        <div class="chat-item">
          <div class="chat-avatar">
            <div class="avatar-placeholder">👤</div>
          </div>
          <div class="chat-info">
            <div class="chat-name">lukfey爱卡菲源码站-月月</div>
            <div class="chat-preview">0000</div>
            <div class="chat-time">2025.8.7 08:25:57</div>
          </div>
        </div>
        
        <div class="chat-item">
          <div class="chat-avatar">
            <div class="avatar-placeholder">👤</div>
          </div>
          <div class="chat-info">
            <div class="chat-name">lukfey爱卡菲源码站-月月</div>
            <div class="chat-preview">咽咽</div>
            <div class="chat-time">2025.8.7 00:38:21</div>
          </div>
        </div>
      </div>
    </div>

    <!-- 聊天主区域 -->
    <div class="chat-main">
      <!-- 聊天头部 -->
      <div class="chat-header">
        <div class="chat-title">
          <span class="title-text">lukfey爱卡菲源...</span>
          <div class="status-badges">
            <span class="badge online">在线</span>
            <span class="badge satisfaction">好评率 97.2%</span>
            <span class="badge level">大客户</span>
          </div>
        </div>
        <div class="chat-actions">
          <button class="action-btn">📞</button>
          <button class="action-btn">📹</button>
          <button class="action-btn">⚙️</button>
        </div>
      </div>

      <!-- 消息区域 -->
      <div class="messages-area">
        <div class="message-item received">
          <div class="message-avatar">
            <div class="avatar-placeholder">👤</div>
          </div>
          <div class="message-content">
            <div class="message-info">
              <span class="sender-name">lukfey爱卡菲源码站...</span>
              <span class="message-time">2025.8.7 09:25:44</span>
            </div>
            <div class="message-text">lukfey爱卡菲源码站...</div>
          </div>
        </div>

        <div class="message-item sent">
          <div class="message-content">
            <div class="message-info">
              <span class="message-time">2025.8.7 08:25:57</span>
            </div>
            <div class="message-text">可以了，谢谢</div>
          </div>
        </div>

        <div class="message-item received">
          <div class="message-avatar">
            <div class="avatar-placeholder">👤</div>
          </div>
          <div class="message-content">
            <div class="message-info">
              <span class="sender-name">lukfey爱卡菲源码站-月月</span>
              <span class="message-time">2025.8.7 00:38:21</span>
            </div>
            <div class="message-text">咽咽</div>
          </div>
        </div>
      </div>

      <!-- 输入区域 -->
      <div class="input-area">
        <div class="input-toolbar">
          <button class="toolbar-btn">😊</button>
          <button class="toolbar-btn">📎</button>
          <button class="toolbar-btn">🖼️</button>
          <button class="toolbar-btn">📷</button>
        </div>
        <div class="input-box">
          <textarea placeholder="请输入消息..." rows="3"></textarea>
          <div class="input-actions">
            <span class="shortcut-hint">发送</span>
            <button class="send-btn">发送</button>
          </div>
        </div>
      </div>
    </div>

    <!-- 右侧客户信息 -->
    <div class="customer-info">
      <div class="customer-header">
        <div class="customer-avatar">
          <div class="avatar-placeholder">👤</div>
        </div>
        <div class="customer-details">
          <h3>lukfey爱卡菲源码站</h3>
          <div class="customer-tags">
            <span class="tag">智能客服</span>
            <span class="tag">新客户</span>
          </div>
        </div>
      </div>

      <div class="customer-tabs">
        <div class="tab active">足迹</div>
        <div class="tab">推荐</div>
      </div>

      <div class="customer-content">
        <div class="info-section">
          <h4>客户信息</h4>
          <div class="info-item">
            <span class="label">姓名:</span>
            <span class="value">lukfey</span>
          </div>
          <div class="info-item">
            <span class="label">来源:</span>
            <span class="value">官网咨询</span>
          </div>
        </div>

        <div class="history-section">
          <h4>近3个月订单 历史订单</h4>
          <div class="empty-state">
            <p>暂无订单信息</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
// 这里可以添加必要的逻辑
</script>

<style scoped>
.chat-interface {
  display: flex;
  height: 100vh;
  background: #f5f7fa;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 左侧边栏 */
.sidebar {
  width: 60px;
  background: #4285f4;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
}

.sidebar-header {
  margin-bottom: 30px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 10px;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  font-size: 12px;
  text-align: center;
  display: block;
}

.sidebar-nav {
  flex: 1;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px 0;
  cursor: pointer;
  border-radius: 8px;
  margin: 5px;
  transition: background-color 0.2s;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
}

.nav-icon {
  font-size: 20px;
  margin-bottom: 5px;
}

.nav-item span {
  font-size: 10px;
}

.chat-stats {
  margin-top: auto;
}

.stat-item {
  text-align: center;
  font-size: 12px;
}

.stat-value {
  display: block;
  font-size: 18px;
  font-weight: bold;
}

/* 聊天列表 */
.chat-list {
  width: 300px;
  background: white;
  border-right: 1px solid #e1e5e9;
  display: flex;
  flex-direction: column;
}

.chat-list-header {
  padding: 15px;
  border-bottom: 1px solid #e1e5e9;
}

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 8px 35px 8px 12px;
  border: 1px solid #e1e5e9;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
}

.chat-items {
  flex: 1;
  overflow-y: auto;
}

.chat-item {
  display: flex;
  padding: 15px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s;
}

.chat-item:hover,
.chat-item.active {
  background: #f8f9fa;
}

.chat-item.active {
  border-right: 3px solid #4285f4;
}

.chat-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 12px;
  flex-shrink: 0;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-info {
  flex: 1;
  min-width: 0;
}

.chat-name {
  font-weight: 500;
  font-size: 14px;
  color: #333;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-preview {
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-time {
  font-size: 11px;
  color: #999;
}

/* 聊天主区域 */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #e1e5e9;
  background: white;
}

.chat-title {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.title-text {
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.status-badges {
  display: flex;
  gap: 8px;
}

.badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.badge.online {
  background: #e8f5e8;
  color: #2e7d32;
}

.badge.satisfaction {
  background: #fff3e0;
  color: #f57c00;
}

.badge.level {
  background: #e3f2fd;
  color: #1976d2;
}

.chat-actions {
  display: flex;
  gap: 10px;
}

.action-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s;
}

.action-btn:hover {
  background: #e0e0e0;
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #fafbfc;
}

.message-item {
  display: flex;
  margin-bottom: 20px;
  align-items: flex-start;
}

.message-item.sent {
  justify-content: flex-end;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 12px;
  flex-shrink: 0;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-content {
  max-width: 60%;
}

.message-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
  font-size: 12px;
  color: #666;
}

.message-text {
  background: white;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-item.sent .message-text {
  background: #4285f4;
  color: white;
}

.input-area {
  border-top: 1px solid #e1e5e9;
  background: white;
}

.input-toolbar {
  display: flex;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.toolbar-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.toolbar-btn:hover {
  background: #f0f0f0;
}

.input-box {
  padding: 15px 20px;
}

.input-box textarea {
  width: 100%;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  resize: none;
  outline: none;
  font-family: inherit;
}

.input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.shortcut-hint {
  font-size: 12px;
  color: #666;
}

.send-btn {
  padding: 8px 20px;
  background: #4285f4;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.send-btn:hover {
  background: #3367d6;
}

/* 右侧客户信息 */
.customer-info {
  width: 300px;
  background: white;
  border-left: 1px solid #e1e5e9;
  display: flex;
  flex-direction: column;
}

.customer-header {
  padding: 20px;
  border-bottom: 1px solid #e1e5e9;
  text-align: center;
}

.customer-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 12px;
}

.customer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.customer-details h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #333;
}

.customer-tags {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.tag {
  padding: 2px 8px;
  background: #f0f0f0;
  border-radius: 12px;
  font-size: 11px;
  color: #666;
}

.customer-tabs {
  display: flex;
  border-bottom: 1px solid #e1e5e9;
}

.tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab.active {
  color: #4285f4;
  border-bottom-color: #4285f4;
}

.customer-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.info-section,
.history-section {
  margin-bottom: 25px;
}

.info-section h4,
.history-section h4 {
  margin: 0 0 15px 0;
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.info-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

.label {
  color: #666;
}

.value {
  color: #333;
}

.empty-state {
  text-align: center;
  color: #999;
  font-size: 13px;
  padding: 20px 0;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 头像占位符样式 */
.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border-radius: 50%;
  font-size: 16px;
  color: #666;
}
</style>